package com.training.java.redbox.struts.domain;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MovieServiceImpl implements MovieService{
	
	@Autowired
	private MovieDAO dao;

	@Override
	public List<Movie> getAllMovies() throws ServiceException{
		try 
		{
			return dao.getAllMovies();
		} catch (DAOException e) {
			e.printStackTrace();
			throw new ServiceException(e);
		}
	}
	
	@Override
	public Movie findByMovieId(long id) throws ServiceException {
		try {
			return dao.findByPrimaryKey(id);
		} catch (DAOException e) {
			e.printStackTrace();
			throw new ServiceException(e);
		}
		
	}

	@Override
	public void addMovie(Movie movie) throws DAOException {
		
	}

	@Override
	public void updateMovie(Movie movie) throws DAOException {
		
	}

	@Override
	public void deleteMovie(long id) throws DAOException {
		
	}

	
	}
	
	
	

